#include <stdio.h>
#include <stdlib.h>
int main()
{
    int status;
    if ((status = system(NULL)) < 0)
    {
        printf("system error!\n");
        exit(0);
    }
    printf("exit status = %d\n", status);
    if ((status = system("date")) < 0)
    {
        printf("system error!\n");
        exit(0);
    }
    printf("exit status = %d\n", status);
    if ((status = system("invalidcommand")) < 0)
    {
        printf("system error!\n");
        exit(0);
    }
    printf("exit status = %d\n", status);
    if ((status = system("who;exit 44")) < 0)
    {
        printf("system error!\n");
        exit(0);
    }
    printf("exit status = %d\n", status);
    return 0;
}

// 非零的退出状态码被用来表示程序发生了某种错误或异常情况
// 退出状态码0正常终止